#include"pbar.h"
const char*s = "|/-\\";
void pbar(unsigned int time)
{
   printf("进度条:\n");
   char str[102];
   memset(str,'\0',sizeof(str));
   int cnt = 0;
   int len = strlen(s);
   while(cnt <= TOP)
   {
       printf("[%-100s][%d%%][%c]\r",str,cnt,s[cnt % len]);
       fflush(stdout);
       str[cnt++] = STYLE;
       if(cnt < 100) str[cnt] = RIGHT;
       usleep(time);
   }
  printf("\n");
}
